<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<LinQDemo.Models.Student>" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">

    protected void ClassID_Load(object sender, EventArgs e)
    {
        ClassID.Text = Model.ClassID;
        StudentID.Text = Model.StudentID;
        StudentName.Text = Model.StudentName;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
     <link href="../../Content/Site.css" rel="stylesheet" type="text/css" /> 
    <title>Edit</title>
</head>
<body>
    <form id="form1" runat="server">

        <fieldset>
            <legend>Fields</legend>
            <p>
                <label for="StudentID">StudentID:</label>
                <asp:TextBox ID="StudentID" runat="server"></asp:TextBox>
            </p>
            <p>
                <label for="StudentName">StudentName:</label>
                <asp:TextBox ID="StudentName" runat="server"></asp:TextBox>
            </p>
            <p>
                <label for="ClassID">ClassID:</label>
                <asp:DropDownList ID="ClassID" runat="server" onload="ClassID_Load" 
                    DataSourceID="LinqDataSource1" DataTextField="ClassID" DataValueField="ClassID">
                </asp:DropDownList>
                <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
                    ContextTypeName="LinQDemo.Models.LinQDemoDataContext" OrderBy="ClassID" 
                    Select="new (ClassID)" TableName="Classes">
                </asp:LinqDataSource>
            </p>
            <p>
                <input type="submit" value="Save" />
            </p>
        </fieldset>

    </form>


</body>
</html>

